home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga Format CD 36
/
Amiga Format CD36 (1999-01-22)(Future Publishing)(GB)[!][issue 1999-02].iso
/
-seriously_amiga-
/
misc
/
guides
/
devguide
/
mycheck.rexx
< prev
next >
Wrap
OS/2 REXX Batch file
|
1998-12-07
|
2KB
|
66 lines
/*************************************************
* myCheck.rexx to split $Check1 and $Check2 *
* V1.0 © Heiko Schröder 10/98 *
*************************************************
* *
* 1.0 - erstes Release, um auch Versions mit- *
* einander vergleichen zu können *
*************************************************/
Parse ARG check1","check2
check2=Delstr(check2,1,1)
address command '"SetEnv" Check2='check2
pos1 =lastpos(" ",check1)
check1=Delstr(check1,1,pos1)
address command '"SetEnv" Version='check1
punkt1=lastpos(".",check1)
If punkt1~=0 then check1=Delstr(check1,punkt1,1)
len1=Length(check1)
pos2 =lastpos(" ",check2)
check2=Delstr(check2,1,pos2)
punkt2=lastpos(".",check2)
If punkt2~=0 then check2=Delstr(check2,punkt2,1)
len2=Length(check2)
/* Kontrolle wenn unterschiedlich lange Ganzzahlen */
Select
When punkt1>punkt2 then do
address command '"SetEnv" Checkdev1='1
address command '"SetEnv" Checkdev2='0
Exit
End
When punkt1<punkt2 then do
address command '"SetEnv" Checkdev1='0
address command '"SetEnv" Checkdev2='1
Exit
End
Otherwise NOP
END
/* check2 ist ein paar Stellen zu kurz z.B. 4.34 & 4.0 */
If len1>len2 then check2=Insert("0",check2,len2,len1-len2,"0")
/* check1 ist ein paar Stellen zu kurz z.B. 5.0 & 4.34 */
If len1<len2 then check1=Insert("0",check1,len1,len2-len1,"0")
Select
/* System ist neuer */
When check1>check2 then do
address command '"SetEnv" Checkdev1='1
address command '"SetEnv" Checkdev2='0
End
/* guide ist neuer */
When check1<check2 then do
address command '"SetEnv" Checkdev1='0
address command '"SetEnv" Checkdev2='1
End
/* gleich */
Otherwise do
address command '"SetEnv" Checkdev1='1
address command '"SetEnv" Checkdev2='1
End
End
Exit